package com.u2b.kvdb;



import com.sina.sae.kvdb.SaeKV;
import com.sina.sae.kvdb.SaeKVUtil;
import com.u2b.global.utils.LoggerUtils;

public class KVDBHandler
{
    private final SaeKV kv;

    public KVDBHandler()
    {
        kv = new SaeKV();
        kv.init();

    }

    public void saveToKvdb(String key, String value)
    {
        byte[] buf = SaeKVUtil.StringToByte(value);
        kv.set(key, buf);

    }

    public String getLocationFromKvdb(String key)
    {
        String value=SaeKVUtil.byteToString((byte[]) kv.get(key));
        LoggerUtils.log("getLocationFromKvdb", key, value);
        return value;
        
    }

}
